
<template>
  <div class="popupMask">
    <div class="popupPenal" style="">
      <div class="popPenalTitle">
        <div class="popPenalTitleName">
          {{model == 'taskCopy' ? "任务复制" : '模板复制'}}
        </div>
        <div class="popupClose" v-on:click="close">
          <el-button size="mini">关闭</el-button>
        </div>
      </div>
      <div class="penalContent" >
        <div>
          <div class="penalrow selectw100">
            <div class=" width100 ">
                <div class="inlineblock verticalmiddle">
                  任务名称:
                </div>
                <div class="inlineblock verticalmiddle informationItem">
                    <el-input v-model="taskName" size="mini" placeholder="自动带入被复制任务名称，可编辑"></el-input>
                </div>
            </div>
          </div>
          <div class="penalrow selectw100">
            <div class=" width100 ">
                <div class="inlineblock verticalmiddle">
                  客户名称:
                </div>
                <div class="inlineblock verticalmiddle informationItem">
                	<el-select
		                	filterable
		                	v-model="kehuliebiaoValue"
		                	placeholder="请选择" size="mini" disabled>
		                    <el-option
		                      v-for="item in inspectionUnitTableDate2"
		                      :key="item.id"
		                      :label="item.name"
		                      :value="item.id">
		                    </el-option>
		               </el-select>
                </div>
            </div>
          </div>
        </div>
      </div>
      <div class=" penalFooter">
            <el-button class="penalButton" type="primary" size="mini" v-on:click="makeSure" style = "float:right;">确定</el-button>
            <el-button class="penalButton" size="mini" v-on:click="close" style = "float:right;margin-right:10px;">取消</el-button>
      </div>
    </div>
  </div>
</template>

<script>

import { mapState } from 'vuex'

export default {
  data () {
    return {
      yesornoValue:'1',
      enableStatusValue:'1',
      kehuliebiaoValue:'001',
      canclick:true,
      taskName:''
    }
  },
  computed:{
    ...mapState(['enableStatus','tableHeightA','yesorno','enableStatus','inspectionUnitTableDate2']),
  },
  mounted(){
  	this.taskName = this.$parent.thisNewTaskData.newTaskBasic.name+'（副本）'
  	this.kehuliebiaoValue = this.$parent.thisNewTaskData.newTaskBasic.client
    console.log(this.model)
  },
  watch:{
    kehuliebiaoValue(){
      this.canclick=false;
    }
  },
  props:['newOrEdit','canEdit','model'],
  methods:{
    close(){
      this.$parent.againconfirmShow = false;
    },
    makeSure(){
      this.close();
      this.$parent.thisNewTaskData.newTaskBasic.client = this.kehuliebiaoValue
      this.$parent.thisNewTaskData.newTaskBasic.name = this.taskName

       this.$parent.showButton={
			    		saveButton:true,
			    		submitButton:true,
			    		auditButton:false
			   }
         if(this.model == "taskCopy"){
            this.$parent.callTaskDetail('任务复制',[0,1])
         }else{
           this.$parent.callTaskDetail('模板复制',[0,1])
         }

    }
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.tabName{
    display: inline-block;
    cursor: pointer;
    padding: 0px 15px;
    border: 1px solid #b7b7b7;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    color: #a9a9a9;
}
.activeTab{
  color: #409eff;
}
.tabPageContent{

}
</style>
